﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;


namespace Model_Layer
{
    [DataContract]
    public class Flight
    {
        private int idflight;
        private Airplane objairplane;
        private int traveltime;
        private string timeofdeparture;
        private string timeofarrival;
        private int availableseats;
        private int takenseats;
        private double price;
        private Airport startAirport;//airportObject to get start airport ID
        private Airport destinationAirport;//airportObject to get destination airport ID

        private int idStartAirport;//airportObject to get start airport ID
        private int idDestinationAirport;//airportObject to get destination airport ID

        [DataMember]
        public int IdStartAirport
        {
            get { return idStartAirport; }
            set { idStartAirport = value; }
        }

        [DataMember]
        public int IdDestinationAirport
        {
            get { return idDestinationAirport; }
            set { idDestinationAirport = value; }
        }


        //constructor1  
        public Flight()
        {
        }

        //constructor 2
        public Flight(int idflight, Airplane objairplane, int traveltime, string timeofdeparture, string timeofarrival, int availableseats, int takenseats, double price, Airport startairport, Airport destinationairport, int idstartairport, int iddestinationairport)
        {
            this.idflight = idflight;
            this.objairplane = objairplane;
            this.traveltime = traveltime;
            this.timeofdeparture = timeofdeparture;
            this.timeofarrival = timeofarrival;
            this.availableseats = availableseats;
            this.takenseats = takenseats;
            this.price = price;
            this.startAirport = startairport;
            this.destinationAirport = destinationairport;
            this.idStartAirport = idstartairport;
            this.idDestinationAirport = iddestinationairport;
        }


        //constructor 3
        public Flight(int idflight, int traveltime, string timeofdeparture, string timeofarrival, int availableseats, double price)
        {
            this.idflight = idflight;
            this.traveltime = traveltime;
            this.timeofdeparture = timeofdeparture;
            this.timeofarrival = timeofarrival;
            this.availableseats = availableseats;
            this.price = price;
        }



        //constructor 4 with only flight ID as parameter
        public Flight(int idflight)
        {
            this.idflight = idflight;
        }


        [DataMember]
        public int Idflight
        {
            get { return idflight; }
            set { idflight = value; }
        }


        [DataMember]
        public Airplane Objairplane
        {
            get { return objairplane; }
            set { objairplane = value; }
        }


        [DataMember]
        public int Traveltime
        {
            get { return traveltime; }
            set { traveltime = value; }
        }


        [DataMember]
        public string Timeofdeparture
        {
            get { return timeofdeparture; }
            set { timeofdeparture = value; }
        }


        [DataMember]
        public string Timeofarrival
        {
            get { return timeofarrival; }
            set { timeofarrival = value; }
        }


        [DataMember]
        public int Availableseats
        {
            get { return availableseats; }
            set { availableseats = value; }
        }


        [DataMember]
        public int Takenseats
        {
            get { return takenseats; }
            set { takenseats = value; }
        }


        [DataMember]
        public double Price
        {
            get { return price; }
            set { price = value; }
        }

        [DataMember]
        public Airport StartAirport
        {
            get { return startAirport; }
            set { startAirport = value; }
        }

        [DataMember]
        public Airport DestinationAirport
        {
            get { return destinationAirport; }
            set { destinationAirport = value; }
        }
    }
}
